package com.mvc.service.impl;

import com.jfinal.plugin.activerecord.Page;
import com.mvc.model.Style;
import com.mvc.request.ReqStylePage;
import com.mvc.request.ReturnData;
import com.mvc.response.RspPage;
import com.mvc.service.StyleService;

/***
 * 样式风格
 * 
 * @author Swer
 * 
 */
public class StyleServiceImpl implements StyleService {

	/**
	 * 风格列表【分页】
	 * 
	 * @param req
	 * @return
	 */
	public ReturnData<RspPage<Style>> queryPage(ReqStylePage req) {
		Page<Style> page = Style.dao.getPage(req.getNowPage(),
				req.getPageSize(),req.getType());

		RspPage<Style> rspPage = new RspPage<>();
		rspPage.setNowPage(req.getNowPage());
		rspPage.setTotalPage(page.getTotalPage());
		rspPage.setList(page.getList());
		return new ReturnData<RspPage<Style>>(rspPage, 200, "OK");
	}

}
